home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 63
/
063.d81
/
jeff's top ten
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
182 lines
100 goto120
110 return
120 clr:dimtt$(120),h$(12),c(7),mu$(12),no(12)
130 sp$=" ":x$=chr$(13):poke646,rnd(-ti)
140 h$(12)=" [218][218][218][218] option menu [218][218][218][218]"
150 poke53281,0:poke53280,0:printchr$(142)"[147]";:goto290
160 print"";
170 print" [151][169][153][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
180 print" [151][169] [153][221] [221]"
190 print" [151] [153][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
200 fori=1to12:print" [151] [153][221][152] [153][221]":next
210 print" [151] [153][173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
220 print" [151] N [146][169]"
230 print" N [146][169]"
240 print" [154][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
250 fori=1to4:print" [159] ":next
260 print" [184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
270 print"";:return
280 rem setup
290 gosub160:rem menu
300 fori=1to7:readc(i):next:fori=1to12:readmu$(i):next
310 ms$="please wait 7 seconds...":gosub550
320 open2,8,2,"lists":get#2,a$,a$:fori=1to110:input#2,tt$(i):next:close2
330 gosub1450
340 lt=0:poke214,24
341 poke211,0:sys58732:print"[146] [145]"
342 ms$="please select top-ten topic":gosub550:t(0)=0:t(1)=0:s(0)=0:s(1)=0:it=1
350 gosub1360:lt=0:no$="111100000000":fori=1to10:h$(i)=tt$(i):next
360 gosub570:ifit=12thengosub780:goto350
370 rem game
380 ms$="randomizing the list...":gosub550:gosub700:no$="000000000000":poke211,0
381 poke214,24:sys58732:print"[146][159] [145]"
382 printspc(20-len(tt$(lt))/2)tt$(lt)"[145]"
390 ms$=pl$(pl)+"pick item to move...":gosub550:gosub570
400 ifit=12thengosub780:goto460
410 iftt$(lt*10+it)=h$(it)thent(pl)=t(pl)+1:goto460
420 ms$=pl$(pl)+"place your pick...":gosub550:gosub1210
430 t(pl)=t(pl)+1
440 iftt$(lt*10+it)=h$(it)thens(pl)=s(pl)+1:fori=1to3:gosub1780:next:goto480
450 iftt$(lt*10+it)<>h$(it)thengosub1730
460 gosub1730:ifnpthenlp=notlp:pl=abs(lp)
470 ifmt=4thenmt=1:goto340
480 gosub1360:goto390
490 stop
500 data 15,12,11,12,15,1,15
510 datathis list is in order!,see which items are out-of-place
520 datawimp out and see solution,try a different subject,exit to loadstar
530 data,,,,,," [218][218][218][218] return to list [218][218][218][218]"
540 rem print message at top of menu
550 print"[155]"left$(sp$,34)""spc(21-len(ms$)/2)ms$:return
560 rem generic menu
570 ifit=0thenit=1
580 print"";:fori=1to12
590 print"[152] "h$(i)left$(sp$,33-len(h$(i))):next:print
600 geta$:gosub660:ifa$<>"[145]"anda$<>""anda$<>x$then600
610 ifa$=""thenc=2.5:gosub670:it=it+1:ifit>12thenit=1
620 ifa$="[145]"thenc=2.5:gosub670:it=it-1:ifit<1thenit=12
630 c=5.5:gosub670:ifh$(it)=""then610
640 ifa$=x$thenreturn
650 goto600
660 c=c+.5:ifc>7thenc=1
670 poke646,c(c):poke214,2+it:poke211,4:sys58732
680 print" "h$(it)left$(sp$,33-len(h$(it))):return
690 rem randomize list
700 lt=it:fori=1to10:h$(i)=tt$(it*10+i):next
710 fori=1to10
720 p=int(rnd(0)*10)+1
730 ifh$(p)=""thenp=p-1:goto730
740 ifh$(i)=""thennext:goto770
750 a$=h$(i):h$(i)=h$(p):h$(p)=a$
760 next
770 ms$=" ":gosub550:return
780 gosub1540:ms$="option[160]menu":gosub550:mt=1:print"";:fori=1to12
790 print"[152] "mu$(i)left$(sp$,33-len(mu$(i))):next:print
800 ifno(1)thenpoke631,asc(""):poke198,1
810 geta$:gosub880:ifa$<>"[145]"anda$<>""anda$<>x$then810
820 ifa$=""thenc=2.5:gosub890:mt=mt+1:ifmt>12thenmt=1
830 ifa$="[145]"thenc=2.5:gosub890:mt=mt-1:ifmt<1thenmt=12
840 c=5.5:gosub890:ifmu$(mt)=""orno(mt)thenpoke198,0:goto820
850 ifa$=x$thenifmt=12ormt=4thenreturn
860 ifa$=x$thengosub910:ms$="":gosub550:goto780
870 goto810
880 c=c+.5:ifc>7thenc=1
890 poke646,c(c):poke214,2+mt:poke211,4:sys58732
900 print" "mu$(mt)left$(sp$,33-len(mu$(mt))):return
910 onmtgosub940,1050,1110,1170,1660,110,110,110,110,110,110,1180
920 return
930 rem check list integrity/winner
940 poke198,0:fl=0:fori=1to10:iftt$(lt*10+i)<>h$(i)thenfl=1
950 next:ifflthenms$="oh no it's not! press a key.":gosub550:gosub1730
960 ifflthens(pl)=s(pl)-10:ifs(pl)<0thens(pl)=0
970 ifflththengosub1360:wait198,1:return
980 ms$="you're right! you did it!":gosub550:s(pl)=s(pl)+10:t(pl)=t(pl)+10
990 no$="111001111111":gosub1540:gosub1360:gosub1830:ifnpthengosub1010
1000 return
1010 wi=0:ifs(1)>s(0)thenwi=1
1020 ms$=pl$(wi)+"wins! press a key...":gosub550:poke198,0:wait198,1
1030 no$="111001111111":gosub1360:return
1040 rem see which items are misplaced
1050 print"";:fori=1to10:poke646,12
1060 iftt$(lt*10+i)<>h$(i)thenpoke646,11
1070 print" "h$(i)left$(sp$,33-len(h$(i))):next:gosub1730
1080 ms$="shaded items are misplaced":gosub550
1090 t(pl)=t(pl)+1:gosub1360:poke198,0:wait198,1:return
1100 rem wimp out
1110 ms$="you sure? you'll lose all points":gosub550:poke198,0:wait198,1
1120 geta$:ifa$<>"y"thenreturn
1130 print"";:fori=1to10:gosub1730
1140 print"[152] "tt$(lt*10+i)left$(sp$,33-len(tt$(lt*10+i))):next
1150 ms$="press a key...":gosub550:poke198,0
1160 s(pl)=0:t(pl)=t(pl)+1:gosub1360:wait198,1:geta$:return
1170 return
1180 return
1190 stop
1200 rem place item
1210 p$=h$(it):fl=0:fori=10to1step-1:ifh$(i)=""thenfl=i
1220 next:iffl=0thenfl=10
1230 iffl<>10andfl<>0thenfl=fl-1
1240 geta$:gosub660:ifa$<>"[145]"anda$<>""anda$<>x$then1240
1250 ifa$=""thenifit<flthenc=2.5:gosub1300:gosub670:it=it+1:ifit>flthenit=1
1260 ifa$="[145]"thenifit>1thenc=2.5:gosub1300:gosub670:it=it-1:ifit<1thenit=fl
1270 ifh$(it)=""then1250
1280 ifa$=x$thenreturn
1290 goto1240
1300 ifit=12thenreturn
1310 p1$=h$(it+1):p2$=h$(it-1)
1320 ifa$="[145]"thenh$(it)=p2$:h$(it-1)=p$
1330 ifa$=""thenh$(it)=p1$:h$(it+1)=p$
1340 return
1350 rem take care of player info
1360 poke214,20:poke211,sp:sys58732:poke646,3
1370 print"score: [157][157][157][157]"s(0);:ifnpthenprinttab(19)"score:";
1380 ifnpthenpoke214,20:poke211,28:sys58732:print" [157][157][157][157]"s(1)
1390 poke214,21:poke211,sp:sys58732
1400 print"accuracy: [157][157][157][157]";:ift(0)thenprintint(s(0)/(t(0)/100)+.5)"[157]% ";
1401 ifnpthenprinttab(19)"accuracy: "
1410 ifnpthenpoke214,21:poke211,28:sys58732
1420 ifnpthenift(1)thenprint" [157][157][157][157]"int(s(1)/(t(1)/100)+.5)"[157]% "
1430 return
1440 rem enter player information
1450 ms$="how many players? (1 or 2)":gosub550:np=0:poke198,0:wait198,1
1460 geta$:ifa$<>"2"anda$<>"1"then1450
1470 ifa$="1"thensp=13:return
1480 sp=2:np=1:ms$="player 1, enter your name below":gosub550
1490 poke214,19:poke211,4:sys58732:li=7:gosub1550:pl$(0)=w$+" ":ifw$=""then1480
1500 ms$="player 2, enter your name below":gosub550
1510 poke214,19:poke211,23:sys58732:li=7:gosub1550:ifw$=""then1500
1520 pl$(1)=w$+" ":return
1530 rem enable/disable menu features
1540 fori=1to12:no(i)=val(mid$(no$,i,1)):next:return
1550 w$="":lw=0:print"[159]>[157]";:iflimit=0thenlimit=80
1560 geta$:ifa$="[145]"ora$=""ora$="[157]"ora$=""ora$=""ora$="[147]"ora$=""then1560
1570 lw=len(w$):as=asc(a$):ifas=13oras=141oras=20then1630
1580 ifa$>="[193]"anda$<="[218]"thenas=as-128:a$=chr$(as)
1590 ifpeek(653)=2orpeek(653)=4oras=148then1560
1600 iflw=limit and(as<>20andas<>13andas<>141)then1560
1610 ifas=34or(as>=133andas<=140)or(as>=1andas<=31)then1560
1620 w$=w$+a$:printa$">[157]";:lw=len(w$):goto1560
1630 ifas=20andw$=""then1560
1640 ifas=20andw$<>""thenw$=left$(w$,lw-1):print"[157]< [157]